


************* This program generates Figure 1, Column A and B, in the paper *************


clear all
set more off

cd "$localdir\Data"
global output "$localdir\Output"


********* Load data *********

use data_survey2015, clear



********* Graphs *********

graph set window fontface "Helvetica"
hist unemp_par, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Parents", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(unemp_par, replace)
hist unemp_sib, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Siblings", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(unemp_sib, replace)
hist unemp_col, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Colleagues", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(unemp_col, replace)
hist unemp_stu, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Study Relations", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(unemp_stu, replace)
gr combine unemp_par unemp_sib unemp_col unemp_stu, title("Network links and discussion intensity: Unemployment", color(black)) graphregion(color(white)) 
gr export "$output/fg1_a.pdf", replace
gr export "$output/fg1_a.eps", replace

graph set window fontface "Helvetica"
hist pol_par, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Parents", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(pol_par, replace)
hist pol_sib, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Siblings", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(pol_sib, replace)
hist pol_col, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Colleagues", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(pol_col, replace)
hist pol_stu, scheme(s1color) color(cranberry) width(1) percent discrete gap(50) title("Study Relations", size(vlarge)) ylabel(0 (5) 25, labsize(medium)) xlabel(0 (1) 10, labsize(medium)) ///
ytitle(, size(medium)) xtitle("Intensity", size(medium)) ///
graphregion(color(white)) yscale(titlegap(*5)) xscale(titlegap(*6)) name(pol_stu, replace)
gr combine pol_par pol_sib pol_col pol_stu, title("Network links and discussion intensity: Politics", color(black)) graphregion(color(white)) 
gr export "$output/fg1_b.pdf", replace
gr export "$output/fg1_b.eps", replace









